/*
 * @lc app=leetcode.cn id=836 lang=javascript
 *
 * [836] 矩形重叠
 */

// @lc code=start
/**
 * @param {number[]} rec1
 * @param {number[]} rec2
 * @return {boolean}
 */
var isRectangleOverlap = function(rec1, rec2) {
    return (Math.min(rec1[2], rec2[2]) > Math.max(rec1[0], rec2[0]) &&Math.min(rec1[3], rec2[3]) > Math.max(rec1[1], rec2[1]))

}//相交面积投影到X轴Y轴，其中线段均在X，Y轴大于0即可，位于右上边的最小值大于位于左下边的最大值
// @lc code=end

var isRectangleOverlap = function(rec1, rec2) {
    const [x1, y1, x2, y2]=rec1
    const [x3, y3, x4, y4]=rec2
    if(x2<=x3||y1>=y4||x1>=x4||y2<=y3) return false
    return true

}//有毒